package com.linwen.javase.desgin_pattern.BigTalkDesignPattenJAVACode._14备忘录模式._3游戏角色状态;

public class Test {
	
	public static void main(String[] args){


        //大战Boss前
        GameRole role = new GameRole();
        role.getInitState();
        role.displayState();

        //保存进度
        RoleStateCaretaker stateAdmin = new RoleStateCaretaker();
        stateAdmin.setRoleStateMemento(role.saveState());

        //大战Boss时，损耗严重
        role.fight();
        //显示状态
        role.displayState();

        //游戏进度恢复
        role.recoveryState(stateAdmin.getRoleStateMemento());

        //显示状态
        role.displayState();

	}
}



